<!--
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				ProjectBreakDownReport.jsp
  //	TITLE:				
  //	FUNCTION:			
  //	BY:					Nick Huang
  //	DATE:				2013-06-25
  // --------------------------------------------------------------
-->

<html>
<%@ include file="../tssheader.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld" %>
<%@ taglib prefix="fmt" uri="/WEB-INF/tlds/fmt.tld" %>

<%
    
	String begin_date = request.getParameter("date_from");
	String end_date = request.getParameter("date_to");

	List reportList = (List)request.getAttribute("reportList");

%>
<body>
<h2>Project Breakdown</h2>

<c:if test="${flag == 'N'}">
	<font color=orange>Query Failure!</font>
</c:if>

<table>
<tr>		
	<td>Date From: </td>
	<td><%= begin_date %></td>
</tr>
<tr>
	<td>Date To: </td>
	<td><%= end_date %></td>
</tr>
</table>

<br>

<table border=1>

<tr>
	<td align='center' nowrap>
		<b>Project</b>
	</td>
	<td align='center' nowrap>
		<b>Development</b>
	</td>
	<td align='center' nowrap>
		<b>Support</b>
	</td>
	<td align='center' nowrap>
		<b>Incident</b>
	</td>
	<td align='center' nowrap>
		<b>Operation</b>
	</td>
</tr>

<c:forEach items="${reportList}" var="record" varStatus="status" >

	<c:choose>
		<c:when test="${status.last}">
			<tr>
				<td nowrap align='left'>

					<c:choose>
						<c:when test="${record.Project == ''}">
							&nbsp;
						</c:when>
						<c:otherwise>
							<c:out value="${record.Project}"></c:out>
						</c:otherwise>
					</c:choose>

				</td>
				<td nowrap align='right'>
					<fmt:formatNumber type="percent" value="${record.Development}" />
				</td>
				<td nowrap align='right'>
					<fmt:formatNumber type="percent" value="${record.Support}" />
				</td>
				<td nowrap align='right'>
					<fmt:formatNumber type="percent" value="${record.Incident}" />
				</td>
				<td nowrap align='right'>
					<fmt:formatNumber type="percent" value="${record.Operation}" />
				</td>
			</tr>
		</c:when>

		<c:otherwise>
			<tr>
				<td nowrap align='left'>

					<c:choose>
						<c:when test="${record.Project == ''}">
							&nbsp;
						</c:when>
						<c:otherwise>
							<c:out value="${record.Project}"></c:out>
						</c:otherwise>
					</c:choose>

				</td>
				<td nowrap align='right'>
					<fmt:formatNumber pattern="###.##" value="${record.Development}" />
				</td>
				<td nowrap align='right'>
					<fmt:formatNumber pattern="###.##" value="${record.Support}" />
				</td>
				<td nowrap align='right'>
					<fmt:formatNumber pattern="###.##" value="${record.Incident}" />
				</td>
				<td nowrap align='right'>
					<fmt:formatNumber pattern="###.##" value="${record.Operation}" />
				</td>
			</tr>
		</c:otherwise>
	</c:choose>

</c:forEach>

</table>

<br>
<hr>
<p>
<INPUT type=button value=Back onclick="location.href='<%=contextPath%>/tss/projectbreakdown/ProjectBreakDownExport.jsp'">
</p>
</body>
<%@ include file="../tssfooter.jsp" %>
</html>

